using UnityEngine;

public class GameManager : MonoBehaviour
{
    public static GameManager Instance { get; private set; }

    private void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
            DontDestroyOnLoad(gameObject);
        }
        else
        {
            Destroy(gameObject);
        }
    }

    // 当前选择的游戏
    public enum GameType
    {
        None,
        NumberPuzzle,
        MemoryMatch,
        Tetris,
        ConnectClear
    }

    public GameType CurrentGame { get; private set; } = GameType.None;

    // 设置当前游戏
    public void SetCurrentGame(GameType gameType)
    {
        CurrentGame = gameType;
    }

    // 返回主菜单
    public void ReturnToMainMenu()
    {
        CurrentGame = GameType.None;
        SceneLoader.Instance.LoadMainMenu();
    }
}
